﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace TestMiniDump
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        /// <summary>
        /// This example shows how all unhandled exceptions are caught by the custom Health Monitor Provider created by us, and a dump is created in 
        /// the path configured in web.config
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnThrowdotNetEx_Click(object sender, EventArgs e)
        {
            throw new StackOverflowException();
        }
        /// <summary>
        /// This example shows us how to force generate a Memory Dump Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnRaiseMemDumpEvent_Click(object sender, EventArgs e)
        {
            HealthMonitoring.MemoryDumpEvent memEvent = new HealthMonitoring.MemoryDumpEvent("Force a Dump to be written", this.btnRaiseMemDumpEvent, new ApplicationException("Force it") );
                memEvent.Raise()  ;   
        }
    }
}
